home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1PA6NFT (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.6 KB  |  65 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import java.beans.PropertyChangeEvent;
  4. import java.beans.PropertyChangeListener;
  5.  
  6. public class BasicComboBoxUI$ComboBoxPropertyChangeListener implements PropertyChangeListener {
  7.    // $FF: synthetic field
  8.    BasicComboBoxUI this$0;
  9.  
  10.    public void propertyChange(PropertyChangeEvent e) {
  11.       String propertyName = e.getPropertyName();
  12.       if (propertyName.equals("model")) {
  13.          if (this.this$0.listBox != null) {
  14.             this.this$0.listBox.setModel(this.this$0.comboBox.getModel());
  15.             if (this.this$0.popupIsVisible()) {
  16.                this.this$0.popup.hide();
  17.             }
  18.          }
  19.       } else if (propertyName.equals("editor") && this.this$0.comboBox.isEditable()) {
  20.          this.this$0.removeEditor();
  21.          this.this$0.addEditor();
  22.       } else if (propertyName.equals("editable")) {
  23.          if (this.this$0.comboBox.isEditable()) {
  24.             this.this$0.comboBox.setRequestFocusEnabled(false);
  25.             this.this$0.comboBox.removeKeyListener(this.this$0.popupKeyListener);
  26.             this.this$0.addEditor();
  27.          } else {
  28.             this.this$0.comboBox.setRequestFocusEnabled(true);
  29.             this.this$0.comboBox.addKeyListener(this.this$0.popupKeyListener);
  30.             this.this$0.removeEditor();
  31.          }
  32.       } else if (propertyName.equals("enabled")) {
  33.          boolean cbIsEnabled = this.this$0.comboBox.isEnabled();
  34.          if (cbIsEnabled) {
  35.             if (this.this$0.editor != null) {
  36.                this.this$0.editor.setEnabled(true);
  37.             }
  38.  
  39.             if (this.this$0.arrowButton != null) {
  40.                this.this$0.arrowButton.setEnabled(true);
  41.             }
  42.          } else {
  43.             if (this.this$0.editor != null) {
  44.                this.this$0.editor.setEnabled(false);
  45.             }
  46.  
  47.             if (this.this$0.arrowButton != null) {
  48.                this.this$0.arrowButton.setEnabled(false);
  49.             }
  50.          }
  51.  
  52.          this.this$0.comboBox.repaint();
  53.       } else if (propertyName.equals("maximumRowCount") && this.this$0.popupIsVisible()) {
  54.          this.this$0.popup.hide();
  55.          this.this$0.popup.show();
  56.       }
  57.  
  58.    }
  59.  
  60.    // $FF: synthetic method
  61.    public BasicComboBoxUI$ComboBoxPropertyChangeListener(BasicComboBoxUI this$0) {
  62.       this.this$0 = this$0;
  63.    }
  64. }
  65.